library(maptools)

# load sources
src <- sapply(list.files("../pkg/R", full.names=TRUE), source)

# load demos
demos <- sapply(list.files("../pkg/demo", full.names=TRUE), source)

locations <- data.frame( x=1:3
                       , y=c(4,1,2)
                       )
fromto <- data.frame( from = c(1,3)
                    , to = c(2,1)
                    , value = c(0.1,0.2)
                    )

arrows <- makeArrows(fromto, locations)
plot(SpatialPolygons(arrows))

# len <- 1000
# locations <- data.frame( x=rnorm(len)
                       # , y=rnorm(len)
                       # )
# slen <- len%/%4
# fromto <- data.frame( from = sample(len, slen)
                    # , to = sample(len, slen)
                    # , value = rnorm(slen)
                    # )
                    
# arrows <- makeArrows(fromto, locations)

# plot(SpatialPolygons(arrows))
           
